﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MvcCoffeeShop.DataTransferObjects;
using MvcCoffeeShop.DataAccess;


namespace MvcCoffeeShop
{
    namespace BusinessLogic
    {
        public class MvcCoffeeShopBL
        {

            MvcCoffeeShopDA oDataAccess;

            public MvcCoffeeShopBL()
            {

                oDataAccess = new MvcCoffeeShopDA();

            }

            public List<ProductDTO> GetProducts()
            {
                var oProducts = new List<ProductDTO>();
                try
                {
                    oProducts = oDataAccess.GetProducts();
                    return oProducts;
                }
                catch (Exception e)
                {
                    throw e;
                }

            }

            public ProductDTO GetProduct(int ProductID)
            {
                var oProduct = new ProductDTO();
                try
                {
                    oProduct = oDataAccess.GetProduct(ProductID);
                    return oProduct;
                }
                catch(Exception e)
                {
                    throw e;
                }

            }


        }
    }
}


